home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume8 / xmail / patch2.03 < prev    next >
Encoding:
Internet Message Format  |  1990-08-27  |  51.9 KB

  1. Path: uunet!snorkelwacker!usc!sdd.hp.com!decwrl!sun-barr!newstop!sun!parns.nsc.com
  2. From: michael@parns.nsc.com (Michael Wagnitz)
  3. Newsgroups: comp.sources.x
  4. Subject: v08i098: xmail, Patch2, Part03/05
  5. Message-ID: <141431@sun.Eng.Sun.COM>
  6. Date: 28 Aug 90 07:49:51 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 1447
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: michael@parns.nsc.com (Michael Wagnitz)
  12. Posting-number: Volume 8, Issue 98
  13. Archive-name: xmail/patch2.03
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 3 (of 5)."
  22. # Contents:  Patch.02a
  23. # Wrapped by michael@harley on Mon Aug 27 12:47:26 1990
  24. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  25. if test -f 'Patch.02a' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'Patch.02a'\"
  27. else
  28. echo shar: Extracting \"'Patch.02a'\" \(49821 characters\)
  29. sed "s/^X//" >'Patch.02a' <<'END_OF_FILE'
  30. XPrereq: 1
  31. X
  32. X*** ../v1.1/patchlevel.h    Mon Jun  4 09:48:28 1990
  33. X--- patchlevel.h    Mon Aug 27 11:09:21 1990
  34. X***************
  35. X*** 1 ****
  36. X! #define PATCHLEVEL 1
  37. X--- 1 ----
  38. X! #define PATCHLEVEL 2
  39. X*** ../v1.1/CHANGES    Mon Jun  4 09:47:30 1990
  40. X--- CHANGES    Mon Aug 27 11:09:16 1990
  41. X***************
  42. X*** 1,2 ****
  43. X--- 1,136 ----
  44. X  
  45. X+                                                                 August, 1990
  46. X+ 
  47. X+    The following changes have been effected for Patchlevel 2 of xmail.
  48. X+ 
  49. X+ 
  50. X+ Imakefile:    Reordered R3 and R4 dependencies to allow for R4 make depend.
  51. X+ 
  52. X+ HelpText.c:    Corrected some text and added help for text window key actions.
  53. X+ 
  54. X+ Mailwatch.c:    Added option to start icon in reverse video.  Also added
  55. X+         option to display the username in the icon window, for those
  56. X+         times when xmail processes for more than one user are desired.
  57. X+ 
  58. X+ actions.c:    Changed Newmail action to NOT automatically remove the
  59. X+         current folder list when changing to the system mail folder.
  60. X+         'Drop Folders' is now a separate action selectable within the
  61. X+         Newmail command menu.  Fixed SetFolders routine to not prepend
  62. X+         the home directory to folder names beginning with either a
  63. X+         dot (.) or foreword slash (/).  Also added a COMMIT option
  64. X+         to change of folder (when current folder has deleted mail)
  65. X+         or cancel of composed message.  Commit option is tailorable
  66. X+         by -e (expert) flag, 'Preserve' menu selection, and/or resource
  67. X+         specification.  Re-edit of the current message composition is
  68. X+         now supported within the 'Send' popup 'Deliver' sub-menu.
  69. X+         Deletions in the 'Send' popup text fields will no longer force
  70. X+         the cursor position to the end of the line.  Additional error
  71. X+         messages from the mail program are also trapped.  To better
  72. X+         support variations in 'Berkeley' mail, 'set no' commands are
  73. X+         no changed to 'unset' commands.  Both forms are also parsed.
  74. X+         To allow pasting of selected text within the various windows,
  75. X+         message indexing is now indicated by a preceeding greater-
  76. X+         than symbol (>) instead of highlighting using the selection
  77. X+         mechanism.
  78. X+ 
  79. X+ callbacks.c:    Mechanisms for delivering mail messages are now forked to a
  80. X+         child process if possible, instead of the previous synchronous
  81. X+         system calls.  Better support for file and folder recipients
  82. X+         to messages are also included.  Changes in folder or quitting
  83. X+         with a modified folder are now confirmed, unless the expert
  84. X+         flag has been specified.  Callbacks for re-editing message
  85. X+         composition and for dropping the current folders list are also
  86. X+         added.
  87. X+ 
  88. X+ confirm.c:    This is a new routine which supplys the confirmation method.
  89. X+ 
  90. X+ defs.h:        Changes to accomodate 'make depend' under X11R4 .vs. X11R3.
  91. X+         Added command line option flag: expert.
  92. X+ 
  93. X+ directory.c:    Modified list display to be more box like, to help prevent
  94. X+         the menu from running off the bottom of the screen.
  95. X+ 
  96. X+ environs.c:    Improved alias parsing routines to separate real people from
  97. X+         file and folder names as recipients of mail messages.  Also
  98. X+         expanded environment variables in GetMailEnv calls.
  99. X+ 
  100. X+ globals.h:    Added definitions for new routines and flags.
  101. X+ 
  102. X+ handler.c:    Removed widget privates dependencies in SystemFolder routine
  103. X+         by correctly calling XtGetValues for the label of the widget.
  104. X+ 
  105. X+ icon.mail:    Modified bitmaps for both icons to allow for placing the
  106. X+         username under the mailbox, when requested.
  107. X+ 
  108. X+ mail.c:        Added editMail routine to support re-edits of message text.
  109. X+ 
  110. X+ parser.c:    Added ability to export the match function to other routines
  111. X+         for better handling of errors from mail.  Changed 'set no'
  112. X+         calls to 'unset's, for support of SONY NEWS OS mail program.
  113. X+         Changed message index highlighting to use the greater-than
  114. X+         symbol (>) instead.  Revert to default mail prompt of received
  115. X+         during startup, for case where user's .mailrc file fails to
  116. X+         parse before the intended prompt can be set.
  117. X+ 
  118. X+ utils.c:    Changed message index selection highlighting to use symbol.
  119. X+ 
  120. X+ windows.c:    Added new command menu options.  Provided for cut and paste
  121. X+         operations in File and text windows.  Added second help
  122. X+         window to text area for mapping of keyboard keys to command
  123. X+         actions.  Added keyboard cursor motion commands to the Index
  124. X+         and Text windows.  Added routine to parse the icon geometry.
  125. X+ 
  126. X+ xmail.c:    Added support for new options: -e (expert), -iconic, and
  127. X+         -rv (reverse video on the icon).  Also default to no position
  128. X+         (0,0) for icon if not explicitly specified.
  129. X+ 
  130. X+ xmail.man:    Many changes to document patchlevel 2 enhancements and fixes.
  131. X+ 
  132. X+ xmailregex.h:    Added support for use outside of the parser routines.  Also
  133. X+         added additional error messages for users with problems in
  134. X+         their environment or .mailrc file.
  135. X+ 
  136. X+ XMail.ad:    Changed the color specifications in the applications defaults
  137. X+         from names to hex values, to provide support when the server
  138. X+         fails to parse color names (a rare but annoying occurance).
  139. X+         Added definitions for the new command menu buttons.
  140. X+ 
  141. X+ 
  142. X+ Again, I'd like to thank the contributors of suggestions and actual patches.
  143. X+ I'd also like to thank those persons who sent in complaints and suggestions.
  144. X+ If I somehow managed to forget some of those persons, I hope they can
  145. X+ forgive me.
  146. X+ 
  147. X+ *) Jeff Dauber was first to request the ability to re-edit new messages.
  148. X+ 
  149. X+ *) Mark Scholl was responsible for requesting the addition of a Confirmation
  150. X+    option.
  151. X+ 
  152. X+ *) More illegal pointer combination fixes, the ParseIconGeometry() routine,
  153. X+    and the expansion of environment variables within the GetMailEnv() routine
  154. X+    were supplied by Christos Zoulas.
  155. X+ 
  156. X+ *) Tom Dunigan and Peter Marshall both pointed out the error of my ways in
  157. X+    handling RFC822 addresses, and supplied much needed help in making the
  158. X+    corrections.
  159. X+ 
  160. X+ *) Peter Marshal also initiated changes to allow a greater variety of editor
  161. X+    choices, including better support for the emacs invocation.  He was also
  162. X+    one of the first to complain about the delays during delivery of messages,
  163. X+    which drove the efforts to fork off those tasks.
  164. X+ 
  165. X+ *) David Elliott suggested the no-default icon position, the missing paste
  166. X+    ability in the File window, and the need to support 'unset' versus 'set no'
  167. X+    construct in mail.
  168. X+ 
  169. X+ *) Suggestions from Casey Leedom precipitated the revision of the Makefile
  170. X+    depends to provide better support for make depend under Sun and X11R4.
  171. X+ 
  172. X+ *) Questions from John Meissen prompted modifications to the way the file
  173. X+    handlers are modified when calling mail and forking edit children.  He also
  174. X+    pointed out the probability of a MAIL environment variable pointing to
  175. X+    the intended mail spool and made suggestions for changing the code.
  176. X+ 
  177. X+ ---------------------- end of changes for patchlevel 2 -----------------------
  178. X+ 
  179. X                                                                     May, 1990
  180. X*** ../v1.1/COPYRIGHT    Mon Jun  4 09:46:24 1990
  181. X--- COPYRIGHT    Mon Aug 27 11:09:16 1990
  182. X***************
  183. X*** 34,36 ****
  184. X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  185. X!  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  186. X   * PERFORMANCE OF THIS SOFTWARE.
  187. X--- 34,36 ----
  188. X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  189. X!  * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  190. X   * PERFORMANCE OF THIS SOFTWARE.
  191. X*** ../v1.1/HelpText.c    Mon Jun  4 09:48:30 1990
  192. X--- HelpText.c    Mon Aug 27 11:09:16 1990
  193. X***************
  194. X*** 19,25 ****
  195. X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
  196. X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  197. X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  198. X!  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  199. X   * PERFORMANCE OF THIS SOFTWARE.
  200. X   *
  201. X   * Author:  Michael C. Wagnitz - National Semiconductor Corporation
  202. X--- 19,25 ----
  203. X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
  204. X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  205. X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  206. X!  * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  207. X   * PERFORMANCE OF THIS SOFTWARE.
  208. X   *
  209. X   * Author:  Michael C. Wagnitz - National Semiconductor Corporation
  210. X***************
  211. X*** 36,42 ****
  212. X  Pressing the right mouse button in this window displays\n\
  213. X  a list of your aliases.  Releasing the right mouse\n\
  214. X  button while one of the alias names is highlighted\n\
  215. X! copies that name into the window, preceeding it with a\n\
  216. X  comma if needed.\n\n\
  217. X  Pressing the backspace or delete key erases a previously\n\
  218. X  entered character.  Control_W (^W) erases a previous\n\
  219. X--- 36,42 ----
  220. X  Pressing the right mouse button in this window displays\n\
  221. X  a list of your aliases.  Releasing the right mouse\n\
  222. X  button while one of the alias names is highlighted\n\
  223. X! copies that name into the window, preceding it with a\n\
  224. X  comma if needed.\n\n\
  225. X  Pressing the backspace or delete key erases a previously\n\
  226. X  entered character.  Control_W (^W) erases a previous\n\
  227. X***************
  228. X*** 48,54 ****
  229. X  Pressing the right mouse button in this window displays a\n\
  230. X  list of your aliases.  Releasing the right mouse button\n\
  231. X  while one of the alias names is highlighted copies that\n\
  232. X! name into the window, preceeded with a comma if needed.\n\n\
  233. X  Pressing the backspace or delete key erases a previously\n\
  234. X  entered character.  Control_W (^W) erases a previous\n\
  235. X  word and Control_U (^U) the entire line.";
  236. X--- 48,54 ----
  237. X  Pressing the right mouse button in this window displays a\n\
  238. X  list of your aliases.  Releasing the right mouse button\n\
  239. X  while one of the alias names is highlighted copies that\n\
  240. X! name into the window, preceded with a comma if needed.\n\n\
  241. X  Pressing the backspace or delete key erases a previously\n\
  242. X  entered character.  Control_W (^W) erases a previous\n\
  243. X  word and Control_U (^U) the entire line.";
  244. X***************
  245. X*** 62,68 ****
  246. X  The uppercase (Copy) command copies the message to a file\n\
  247. X  whose name is derived from the author of the message,\n\
  248. X  rather than from any name currently in the File: window.\n\n\
  249. X! See also the save command for additional information.";
  250. X  
  251. X  String    Delete_Help_Text = "\
  252. X  Pressing this button removes the selected message from the\n\
  253. X--- 62,68 ----
  254. X  The uppercase (Copy) command copies the message to a file\n\
  255. X  whose name is derived from the author of the message,\n\
  256. X  rather than from any name currently in the File: window.\n\n\
  257. X! See also the save command help for additional information.";
  258. X  
  259. X  String    Delete_Help_Text = "\
  260. X  Pressing this button removes the selected message from the\n\
  261. X***************
  262. X*** 77,89 ****
  263. X  See also preserve, save, folder, Newmail, and quit.";
  264. X  
  265. X  String    Deliver_Help_Text = "\
  266. X! The Deliver button will complete the currently composed\n\
  267. X! message and ship it to the sendmail daemon for delivery.\n\n\
  268. X! The right mouse button pops up a menu for both Delivery\n\
  269. X! and Cancel commands.  Selecting Cancel aborts delivery\n\
  270. X! and removes the temporary file, while the third selection\n\
  271. X! saves a copy of the message text in your dead letter file\n\
  272. X! (~/dead.letter by default).";
  273. X  
  274. X  String    File_Help_Text = "\
  275. X  The File: window provides a mechanism for specifying a\n\
  276. X--- 77,93 ----
  277. X  See also preserve, save, folder, Newmail, and quit.";
  278. X  
  279. X  String    Deliver_Help_Text = "\
  280. X! The Deliver button will ship the currently composed message\n\
  281. X! to the system sendmail daemon for delivery to the indicated\n\
  282. X! addressees.\n\n\
  283. X! The right mouse button gives a menu of Delivery, Re-edit,\n\
  284. X! and Cancel commands.\n\n\
  285. X! Use the Re-edit selection to perform additional changes\n\
  286. X! to the current message.\n\n\
  287. X! Selecting \"Cancel, save\" aborts delivery and saves a copy\n\
  288. X! of the message text in your dead letter file\n\
  289. X! ($HOME/dead.letter by default), while the last selection\n\
  290. X! just aborts delivery and removes the temporary file.";
  291. X  
  292. X  String    File_Help_Text = "\
  293. X  The File: window provides a mechanism for specifying a\n\
  294. X***************
  295. X*** 98,110 ****
  296. X  The left button changes the active folder to the one\n\
  297. X  specified in the File: window.  Changing folders COMMITs\n\
  298. X  any modifications to the current folder.\n\n\
  299. X! The right button brings up a list of folders from which\n\
  300. X! to choose.\n\n\
  301. X! Clicking the left button on a directory (indicated by\n\
  302. X! trailing slash) while still holding down the right,\n\
  303. X! expands the directory, if it has files.\n\n\
  304. X  Releasing the right button copies the selected name to\n\
  305. X! the File: window.";
  306. X  
  307. X  String    Hold_Help_Text = "\
  308. X  This command marks the selected message for preservation\n\
  309. X--- 102,116 ----
  310. X  The left button changes the active folder to the one\n\
  311. X  specified in the File: window.  Changing folders COMMITs\n\
  312. X  any modifications to the current folder.\n\n\
  313. X! The right button brings up a menu of folders from which\n\
  314. X! to choose.  Clicking the left button on a directory\n\
  315. X! (indicated by trailing slash) while still holding down\n\
  316. X! the right, expands that directory, if it has files.\n\
  317. X  Releasing the right button copies the selected name to\n\
  318. X! the File: window.\n\n\
  319. X! The current menu can be erased (to include new folders\n\
  320. X! created since the menu was last generated) by using an\n\
  321. X! option provided with the Newmail command button.";
  322. X  
  323. X  String    Hold_Help_Text = "\
  324. X  This command marks the selected message for preservation\n\
  325. X***************
  326. X*** 114,121 ****
  327. X  preserve is used after having saved a message to another\n\
  328. X  file or folder when you still wish to preserve the mail\n\
  329. X  message in your system folder.  (See the mail man page.)\n\n\
  330. X! The right mouse button presents a menu of three mail\n\
  331. X! environment variables that may be altered while in xmail.\n\
  332. X  Commands listed denote what state each variable will be\n\
  333. X  changed to if the appropriate label is highlighted as the\n\
  334. X  mouse button is released.";
  335. X--- 120,127 ----
  336. X  preserve is used after having saved a message to another\n\
  337. X  file or folder when you still wish to preserve the mail\n\
  338. X  message in your system folder.  (See the mail man page.)\n\n\
  339. X! The right mouse button presents a menu of four of the\n\
  340. X! environment variables that may be altered while in xmail.\n\n\
  341. X  Commands listed denote what state each variable will be\n\
  342. X  changed to if the appropriate label is highlighted as the\n\
  343. X  mouse button is released.";
  344. X***************
  345. X*** 123,134 ****
  346. X  String    Index_Help_Text = "\
  347. X  The index window displays a list of mail messages in the\n\
  348. X  current folder, as well as the currently selected message.\n\n\
  349. X! Pressing the left mouse button anywhere on the line marks\n\
  350. X! a message as selected (for other commands) but does not\n\
  351. X  automatically display the message in the text window.\n\n\
  352. X  Pressing the right button selects and also automatically\n\
  353. X! displays the message.\n\n\
  354. X! See also the read command for additional help information.";
  355. X  
  356. X  #ifdef SUNOS_4
  357. X  String    NewMail_Help_Text = "\
  358. X--- 129,143 ----
  359. X  String    Index_Help_Text = "\
  360. X  The index window displays a list of mail messages in the\n\
  361. X  current folder, as well as the currently selected message.\n\n\
  362. X! Pressing the left mouse button anywhere on a line marks\n\
  363. X! the message as selected (for other commands) but does not\n\
  364. X  automatically display the message in the text window.\n\n\
  365. X  Pressing the right button selects and also automatically\n\
  366. X! displays the message.\n\
  367. X! See also the read command help for additional information.\n\n\
  368. X! The index window header list may be scrolled using either\n\
  369. X! the scrollbar and mouse or keyboard keys.  See the Text\n\
  370. X! window help for a description of the keys supported.";
  371. X  
  372. X  #ifdef SUNOS_4
  373. X  String    NewMail_Help_Text = "\
  374. X***************
  375. X*** 138,147 ****
  376. X  folder was accessed.  This action COMMITS any changes to\n\
  377. X  the current folder.\n\n\
  378. X  The Newmail button will highlight whenever new mail has\n\
  379. X! been delivered.  The right mouse button provides a\n\
  380. X! choice between committing changes, or just incorporating\n\
  381. X! new messages without committing changes (only if your\n\
  382. X! system mailbox is already your current folder).";
  383. X  #else
  384. X  String    NewMail_Help_Text = "\
  385. X  Pressing this button causes your system mail folder to\n\
  386. X--- 147,158 ----
  387. X  folder was accessed.  This action COMMITS any changes to\n\
  388. X  the current folder.\n\n\
  389. X  The Newmail button will highlight whenever new mail has\n\
  390. X! been delivered.\n\n\
  391. X! The right mouse button provides a choice of committing\n\
  392. X! changes, just incorporating new messages without\n\
  393. X! committing changes (only if your system mailbox is\n\
  394. X! already your current folder), or dropping any current\n\
  395. X! folder list(s).";
  396. X  #else
  397. X  String    NewMail_Help_Text = "\
  398. X  Pressing this button causes your system mail folder to\n\
  399. X***************
  400. X*** 150,157 ****
  401. X  folder was accessed.  This action COMMITS any changes to\n\
  402. X  the current folder.\n\n\
  403. X  The Newmail button will highlight whenever new mail has\n\
  404. X! been delivered.  The right mouse button is a duplicate\n\
  405. X! of the Newmail command.";
  406. X  #endif
  407. X  
  408. X  String    Print_Help_Text = "\
  409. X--- 161,169 ----
  410. X  folder was accessed.  This action COMMITS any changes to\n\
  411. X  the current folder.\n\n\
  412. X  The Newmail button will highlight whenever new mail has\n\
  413. X! been delivered.\n\n\
  414. X! The right mouse button provides the choice of retrieving\n\
  415. X! new messages or just dropping any current folder list(s).";
  416. X  #endif
  417. X  
  418. X  String    Print_Help_Text = "\
  419. X***************
  420. X*** 160,166 ****
  421. X  A message will be displayed in the status window\n\
  422. X  indicating which message was printed, along with its\n\
  423. X  size in bytes.\n\n\
  424. X! See also the index window for help on selecting a message.";
  425. X  
  426. X  String    Quit_Help_Text = "\
  427. X  quit - terminates xmail, committing changes made to the\n\
  428. X--- 172,178 ----
  429. X  A message will be displayed in the status window\n\
  430. X  indicating which message was printed, along with its\n\
  431. X  size in bytes.\n\n\
  432. X! See also the Index window for help on selecting a message.";
  433. X  
  434. X  String    Quit_Help_Text = "\
  435. X  quit - terminates xmail, committing changes made to the\n\
  436. X***************
  437. X*** 180,186 ****
  438. X  reading it with full header (overrides suppression of\n\
  439. X  normally ignored fields), or reading the next or previous\n\
  440. X  message.\n\n\
  441. X! See also the index window help information.";
  442. X  
  443. X  String    Reply_Help_Text = "\
  444. X  reply - initiates the mechanism to create and send a mail\n\
  445. X--- 192,198 ----
  446. X  reading it with full header (overrides suppression of\n\
  447. X  normally ignored fields), or reading the next or previous\n\
  448. X  message.\n\n\
  449. X! See also the Index window help for more information.";
  450. X  
  451. X  String    Reply_Help_Text = "\
  452. X  reply - initiates the mechanism to create and send a mail\n\
  453. X***************
  454. X*** 189,195 ****
  455. X  'reply', 'reply included', 'replyall' (which addresses all\n\
  456. X  recipients of the original mail), or 'replyall included'.\n\
  457. X  The include options automatically copy the original\n\
  458. X! message into the new one.\n\n\See also the send command.";
  459. X  
  460. X  String    Save_Help_Text = "\
  461. X  save - copies a message to the file or folder named in\n\
  462. X--- 201,207 ----
  463. X  'reply', 'reply included', 'replyall' (which addresses all\n\
  464. X  recipients of the original mail), or 'replyall included'.\n\
  465. X  The include options automatically copy the original\n\
  466. X! message into the new one.\n\nSee also the Send command.";
  467. X  
  468. X  String    Save_Help_Text = "\
  469. X  save - copies a message to the file or folder named in\n\
  470. X***************
  471. X*** 212,218 ****
  472. X  specify the name of the recipient(s), subject, and to whom\n\
  473. X  to send copies of this message.  Pressing the 'Deliver'\n\
  474. X  button completes the operation.\n\n\
  475. X! See also the reply command for additional information.";
  476. X  
  477. X  String    Sign_Help_Text = "\
  478. X  You may insert you choice of the two autograph strings\n\
  479. X--- 224,230 ----
  480. X  specify the name of the recipient(s), subject, and to whom\n\
  481. X  to send copies of this message.  Pressing the 'Deliver'\n\
  482. X  button completes the operation.\n\n\
  483. X! See also the reply command help for additional information.";
  484. X  
  485. X  String    Sign_Help_Text = "\
  486. X  You may insert you choice of the two autograph strings\n\
  487. X***************
  488. X*** 240,249 ****
  489. X  the entire line.";
  490. X  
  491. X  String    Text_Help_Text = "\
  492. X! The text window displays the currently selected message.\n\n\
  493. X! The scrollbar may be used to move the displayed text, as\n\
  494. X! necessary.\n\n\
  495. X! See also the index window for help on selecting a message.";
  496. X  
  497. X  String    Title_Help_Text = "\
  498. X  The Title window displays the\n\n\
  499. X--- 252,300 ----
  500. X  the entire line.";
  501. X  
  502. X  String    Text_Help_Text = "\
  503. X! The text window displays the currently selected message.\n\
  504. X! See the Index window help on how to select a message.\n\n\
  505. X! Text and index windows may be scrolled using either the\n\
  506. X! mouse and scrollbar, or the keyboard keys in the manner\n\
  507. X! of text display programs such as \"more\" and \"less\".\n\n\
  508. X! spacebar - scroll down a page      b - scroll up a page\n\
  509. X! return   - scroll down a line      k - scroll up a line\n\
  510. X!   G      - go to end of text       ' - go to top of text\n\n\
  511. X! The text window also supports keyboard access to each of\n\
  512. X! the command buttons.  See the xmail man page for details,\n\
  513. X! or press the question mark key (?) in the text window.";
  514. X! 
  515. X! #ifdef SUNOS_4
  516. X! String    Text2_Help_Text = "\
  517. X! Keyboard keys which duplicate the command button actions:\n\n\
  518. X!  a - REPLY to all recipients    A  - REPLY to all included\n\
  519. X!  c - COPY a message             C  - COPY to Author file\n\
  520. X!  d - DELETE the message         u  - UNDELETE a message\n\
  521. X!  f - READ with full headers     F  - FORWARD a message\n\
  522. X!  m - MAIL a message             M  - REPLY to a message\n\
  523. X!  i - incorporate NEW MAIL       N  - retrieve NEW MAIL\n\
  524. X!  p - read PREVIOUS message      P  - PRINT a message\n\
  525. X!  r - READ the message           R  - REPLY included\n\
  526. X!  s - SAVE current message       S  - SAVE to author\n\
  527. X!  n - read the NEXT message      w  - WRITE current message\n\
  528. X!  q - QUIT, committing changes   x  - EXIT, no commits\n\
  529. X!  ? - DISPLAY this help info   <LF> - REMOVE this help info";
  530. X! #else
  531. X! String    Text2_Help_Text = "\
  532. X! Keyboard keys which duplicate the command button actions:\n\n\
  533. X!  a - REPLY to all recipients    A  - REPLY to all included\n\
  534. X!  c - COPY a message             C  - COPY to Author file\n\
  535. X!  d - DELETE the message         u  - UNDELETE a message\n\
  536. X!  f - READ with full headers     F  - FORWARD a message\n\
  537. X!  m - MAIL a message             M  - REPLY to a message\n\
  538. X!  n - read the NEXT message      N  - retrieve NEW MAIL\n\
  539. X!  p - read PREVIOUS message      P  - PRINT a message\n\
  540. X!  r - READ the message           R  - REPLY included\n\
  541. X!  s - SAVE current message       S  - SAVE to author\n\
  542. X!  q - QUIT, committing changes   w  - WRITE current message\n\
  543. X!  x - EXIT, no commits\n\
  544. X!  ? - DISPLAY this help info   <LF> - REMOVE this help info";
  545. X! #endif
  546. X  
  547. X  String    Title_Help_Text = "\
  548. X  The Title window displays the\n\n\
  549. X*** ../v1.1/Imakefile    Mon Jun  4 09:48:31 1990
  550. X--- Imakefile    Mon Aug 27 11:09:17 1990
  551. X***************
  552. X*** 1,5 ****
  553. X  #
  554. X! # Imakefile for xmail 1.1
  555. X  #
  556. X  # SUNOS_4 is defined if compiling under Sun OS 4.x - newer directory routines
  557. X  #
  558. X--- 1,5 ----
  559. X  #
  560. X! # Imakefile for xmail 1.2
  561. X  #
  562. X  # SUNOS_4 is defined if compiling under Sun OS 4.x - newer directory routines
  563. X  #
  564. X***************
  565. X*** 18,28 ****
  566. X    LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
  567. X  
  568. X               SRCS = Mailwatch.c HelpText.c actions.c callMail.c callbacks.c \
  569. X!             directory.c environs.c handler.c mail.c parser.c \
  570. X              regex.c utils.c windows.c xmail.c
  571. X  
  572. X               OBJS = Mailwatch.o HelpText.o actions.o callMail.o callbacks.o \
  573. X!             directory.o environs.o handler.o mail.o parser.o \
  574. X              regex.o utils.o windows.o xmail.o
  575. X  
  576. X  ComplexProgramTarget(xmail)
  577. X--- 18,28 ----
  578. X    LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
  579. X  
  580. X               SRCS = Mailwatch.c HelpText.c actions.c callMail.c callbacks.c \
  581. X!             confirm.c directory.c environs.c handler.c mail.c parser.c \
  582. X              regex.c utils.c windows.c xmail.c
  583. X  
  584. X               OBJS = Mailwatch.o HelpText.o actions.o callMail.o callbacks.o \
  585. X!             confirm.o directory.o environs.o handler.o mail.o parser.o \
  586. X              regex.o utils.o windows.o xmail.o
  587. X  
  588. X  ComplexProgramTarget(xmail)
  589. X*** ../v1.1/Mailwatch.c    Mon Jun  4 09:48:32 1990
  590. X--- Mailwatch.c    Mon Aug 27 11:09:17 1990
  591. X***************
  592. X*** 55,61 ****
  593. X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
  594. X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  595. X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  596. X!  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  597. X   * PERFORMANCE OF THIS SOFTWARE.
  598. X   *
  599. X   * The following software modules were created and are Copyrighted by National
  600. X--- 55,61 ----
  601. X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
  602. X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  603. X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  604. X!  * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  605. X   * PERFORMANCE OF THIS SOFTWARE.
  606. X   *
  607. X   * The following software modules were created and are Copyrighted by National
  608. X***************
  609. X*** 87,93 ****
  610. X  #define    flagdown_width    no_mail_width
  611. X  #define    flagdown_height    no_mail_height
  612. X  
  613. X! #define between(x, i, y)    ((i) < (x) ? (x) : (i) > (y) ? (y) : (i))
  614. X  
  615. X  #define REMOVE_TIMEOUT(id) if (!id) ; else XtRemoveTimeOut(id)
  616. X  #ifdef X11R2
  617. X--- 87,93 ----
  618. X  #define    flagdown_width    no_mail_width
  619. X  #define    flagdown_height    no_mail_height
  620. X  
  621. X! #define between(x, i, y)   ((i) < (x) ? (x) : (i) > (y) ? (y) : (i))
  622. X  
  623. X  #define REMOVE_TIMEOUT(id) if (!id) ; else XtRemoveTimeOut(id)
  624. X  #ifdef X11R2
  625. X***************
  626. X*** 98,108 ****
  627. X  static struct stat stbuf;
  628. X  static Pixmap ReadBitmapFile();
  629. X  static Boolean SetValues();
  630. X! static GC GetNormalGC();
  631. X  extern void
  632. X      reset_mailbox();
  633. X  static void
  634. X!     GetMailFile(), CloseDown(), check_mailbox(), redraw_mailbox(),
  635. X      Initialize(), Realize(), Destroy(), Redisplay(), clock_tic();
  636. X  
  637. X  #define min(a,b) ((a) < (b) ? (a) : (b))
  638. X--- 98,108 ----
  639. X  static struct stat stbuf;
  640. X  static Pixmap ReadBitmapFile();
  641. X  static Boolean SetValues();
  642. X! static GC GetNormalGC(), GetInvertGC();
  643. X  extern void
  644. X      reset_mailbox();
  645. X  static void
  646. X!     GetMailFile(), GetUserName(), CloseDown(), check_mailbox(), redraw_mailbox(),
  647. X      Initialize(), Realize(), Destroy(), Redisplay(), clock_tic();
  648. X  
  649. X  #define min(a,b) ((a) < (b) ? (a) : (b))
  650. X***************
  651. X*** 146,151 ****
  652. X--- 146,155 ----
  653. X      offset(mail), XtRString, NULL},
  654. X      {XtNcallback, XtCCallback, XtRCallback, sizeof(caddr_t),
  655. X      offset(callback), XtRCallback, NULL},
  656. X+     {"useName", XtCBoolean, XtRBoolean, sizeof(Boolean),
  657. X+     offset(useName), XtRString, (caddr_t) "FALSE" },
  658. X+     { XtNfont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
  659. X+     offset(font), XtRString, "fixed"},
  660. X  };
  661. X  
  662. X  #undef offset
  663. X***************
  664. X*** 199,204 ****
  665. X--- 203,210 ----
  666. X      register Display *dpy = XtDisplay(new);
  667. X      int depth = DefaultDepth(dpy, DefaultScreen(dpy)), wid, hgt;
  668. X  
  669. X+     GetUserName(w);
  670. X+ 
  671. X      if (!w->mailbox.filename)
  672. X      GetMailFile(w);
  673. X  
  674. X***************
  675. X*** 212,217 ****
  676. X--- 218,226 ----
  677. X  
  678. X      GetNormalGC(w);
  679. X  
  680. X+     if (w->mailbox.useName)
  681. X+        GetInvertGC(w);
  682. X+ 
  683. X      /*
  684. X       * build up the pixmaps that we'll put into the image
  685. X       */
  686. X***************
  687. X*** 299,304 ****
  688. X--- 308,328 ----
  689. X      w->mailbox.normal_GC = XtGetGC((Widget) w, valuemask, &xgcv);
  690. X  }
  691. X  
  692. X+ static GC
  693. X+ GetInvertGC(w)
  694. X+ MailwatchWidget w;
  695. X+ {
  696. X+     XtGCMask valuemask;
  697. X+     XGCValues xgcv;
  698. X+ 
  699. X+     valuemask = GCForeground | GCBackground | GCFunction | GCGraphicsExposures;
  700. X+     xgcv.foreground = w->core.background_pixel;
  701. X+     xgcv.background = w->mailbox.foreground_pixel;
  702. X+     xgcv.function = GXcopy;
  703. X+     xgcv.graphics_exposures = False;    /* this is Bool, not Boolean */
  704. X+     w->mailbox.invert_GC = XtGetGC((Widget) w, valuemask, &xgcv);
  705. X+ }
  706. X+ 
  707. X  static Pixmap
  708. X  ReadBitmapFile(dpy, root, file, width, height)
  709. X  Display *dpy;
  710. X***************
  711. X*** 336,341 ****
  712. X--- 360,366 ----
  713. X      MailwatchWidget w = (MailwatchWidget) gw;
  714. X  
  715. X      XtFree(w->mailbox.filename);
  716. X+     XtFree(w->mailbox.username);
  717. X      REMOVE_TIMEOUT(w->mailbox.interval_id);
  718. X      XtReleaseGC(w, w->mailbox.normal_GC);
  719. X      XFreePixmap(XtDisplay(w), w->mailbox.flagup_pixmap);
  720. X***************
  721. X*** 356,363 ****
  722. X  /*
  723. X  ** Modified to NOT update the mail file timestamp via utimes(), and to
  724. X  ** ignore state change where mail adds a status record to the message.
  725. X! ** The first elminates collisions with mail during delivery, and the
  726. X! ** second elminates false triggers for new mail.  The number of times
  727. X  ** the terminal bell is rung is controlled by the same .mailrc resource
  728. X  ** (bell) used by Sunview's mailtool.
  729. X  */
  730. X--- 381,388 ----
  731. X  /*
  732. X  ** Modified to NOT update the mail file timestamp via utimes(), and to
  733. X  ** ignore state change where mail adds a status record to the message.
  734. X! ** The first eliminates collisions with mail during delivery, and the
  735. X! ** second eliminates false triggers for new mail.  The number of times
  736. X  ** the terminal bell is rung is controlled by the same .mailrc resource
  737. X  ** (bell) used by Sunview's mailtool.
  738. X  */
  739. X***************
  740. X*** 413,447 ****
  741. X  } /* check_mailbox */
  742. X  
  743. X  /*
  744. X!  * get user name for building mailbox
  745. X!  */
  746. X  static void
  747. X  GetMailFile(w)
  748. X  MailwatchWidget w;
  749. X  {
  750. X!     char *getlogin();
  751. X!     char *username;
  752. X!     int len;
  753. X  
  754. X-     username = getlogin();
  755. X-     if (!username) {
  756. X-     struct passwd *pw = getpwuid(getuid());
  757. X  
  758. X!     if (!pw) {
  759. X!         fprintf(stderr, "%s:  unable to find a username for you.\n",
  760. X!         "Mailbox widget");
  761. X!         CloseDown(w, 1);
  762. X!     }
  763. X!     username = pw->pw_name;
  764. X!     }
  765. X!     if (!(w->mailbox.filename = (String) XtMalloc(strlen(MAILBOX_DIRECTORY)+1
  766. X!       + strlen(username)+1))) {
  767. X!     fprintf(stderr, "can't allocate enough memory for widget.\n");
  768. X!     exit(1);
  769. X!     }
  770. X!     sprintf(w->mailbox.filename, "%s/%s", MAILBOX_DIRECTORY, username);
  771. X! }
  772. X  
  773. X  static void
  774. X  CloseDown(w, status)
  775. X  MailwatchWidget w;
  776. X--- 438,487 ----
  777. X  } /* check_mailbox */
  778. X  
  779. X  /*
  780. X! ** Retrieve the user's mailbox filename - use MAIL environment value, if set
  781. X! */
  782. X  static void
  783. X  GetMailFile(w)
  784. X  MailwatchWidget w;
  785. X  {
  786. X!  if (! (w->mailbox.filename = (char *) GetMailEnv("MAIL"))) {
  787. X!     if (! (w->mailbox.filename = (String) XtMalloc(strlen(MAILBOX_DIRECTORY) + 1
  788. X!       + strlen(w->mailbox.username) + 1))) {
  789. X!        fprintf(stderr, "Mailbox widget: can't allocate enough memory.\n");
  790. X!        CloseDown(w, 1);
  791. X!       }
  792. X!     sprintf(w->mailbox.filename,"%s/%s",MAILBOX_DIRECTORY,w->mailbox.username);
  793. X!    }
  794. X! } /* GetMailFile */
  795. X  
  796. X  
  797. X! /*
  798. X! ** Retrieve the mailbox user's name
  799. X! */
  800. X! static void
  801. X! GetUserName(w)
  802. X! MailwatchWidget w;
  803. X! {
  804. X!  char *username = (char *)getlogin();
  805. X  
  806. X+  if (! username) {
  807. X+     struct passwd *pw = getpwuid(getuid());
  808. X+ 
  809. X+     if (! pw) {
  810. X+        fprintf(stderr, "Mailbox widget: can't find your username.\n");
  811. X+        CloseDown(w, 1);
  812. X+       }
  813. X+     username = pw->pw_name;
  814. X+    }
  815. X+ 
  816. X+  if (! (w->mailbox.username = (String) XtMalloc(strlen(username) + 1))) {
  817. X+     fprintf(stderr, "Mailbox widget: can't allocate space for username.\n");
  818. X+     CloseDown(w, 1);
  819. X+    }
  820. X+  sprintf(w->mailbox.username, "%s", username);
  821. X+ } /* GetUserName */
  822. X+ 
  823. X+ 
  824. X  static void
  825. X  CloseDown(w, status)
  826. X  MailwatchWidget w;
  827. X***************
  828. X*** 481,509 ****
  829. X   * drawing code
  830. X   */
  831. X  static void
  832. X! redraw_mailbox(mw)
  833. X! MailwatchWidget mw;
  834. X  {
  835. X!     register Display *dpy = XtDisplay(mw);
  836. X!     register Window win = XtWindow(mw);
  837. X!     register int x, y, w, h;
  838. X!     Pixmap picture;
  839. X  
  840. X  
  841. X      XClearWindow(dpy, win);
  842. X!     if (mw->mailbox.flag_up) {            /* paint the "up" position */
  843. X!     picture = mw->mailbox.flagup_pixmap;
  844. X      w = pix_up_w, h = pix_up_h;
  845. X      } else {                    /* paint the "down" position */
  846. X!     picture = mw->mailbox.flagdown_pixmap;
  847. X      w = pix_dn_w, h = pix_dn_h;
  848. X      }
  849. X  
  850. X      /* center the picture in the window */
  851. X!     x = (mw->core.width - w) / 2;
  852. X!     y = (mw->core.height - h) / 2;
  853. X  
  854. X!     XCopyArea(dpy, picture, win, mw->mailbox.normal_GC, 0, 0, w, h, x, y);
  855. X  }
  856. X  
  857. X  
  858. X--- 521,570 ----
  859. X   * drawing code
  860. X   */
  861. X  static void
  862. X! redraw_mailbox(m)
  863. X! MailwatchWidget m;
  864. X  {
  865. X!     register Display    *dpy = XtDisplay(m);
  866. X!     register Window    win = XtWindow(m);
  867. X!     register int    x, y, w, h;
  868. X!     Pixmap        picture;
  869. X  
  870. X  
  871. X      XClearWindow(dpy, win);
  872. X!     if (m->mailbox.flag_up) {            /* paint the "up" position */
  873. X!     picture = m->mailbox.flagup_pixmap;
  874. X      w = pix_up_w, h = pix_up_h;
  875. X      } else {                    /* paint the "down" position */
  876. X!     picture = m->mailbox.flagdown_pixmap;
  877. X      w = pix_dn_w, h = pix_dn_h;
  878. X      }
  879. X  
  880. X      /* center the picture in the window */
  881. X!     x = (m->core.width - w) / 2;
  882. X!     y = (m->core.height - h) / 2;
  883. X  
  884. X!     XCopyArea(dpy, picture, win, m->mailbox.normal_GC, 0, 0, w, h, x, y);
  885. X! 
  886. X! /*
  887. X! ** This hack exists because the font metrics LIE about the 'fixed' font width
  888. X! */
  889. X!     if (m->mailbox.useName) {
  890. X!        h = m->mailbox.font->max_bounds.width - m->mailbox.font->max_bounds.lbearing;
  891. X!        w = strlen(m->mailbox.username);
  892. X!        h *= w;
  893. X!        x = m->core.width - (h - 2);
  894. X!        if (x < 2)
  895. X!           x = 2;
  896. X!        x /= 2;
  897. X! 
  898. X!        y = m->core.height - m->mailbox.font->descent;
  899. X! 
  900. X!        XFillRectangle(dpy, win, m->mailbox.invert_GC,
  901. X!                       0, y - m->mailbox.font->ascent, m->core.width,
  902. X!                       m->mailbox.font->ascent + m->mailbox.font->descent);
  903. X! 
  904. X!        XDrawString(dpy, win, m->mailbox.normal_GC, x, y, m->mailbox.username, w);
  905. X!       }
  906. X  }
  907. X  
  908. X  
  909. X***************
  910. X*** 516,519 ****
  911. X   w->mailbox.flag_up = FALSE;
  912. X   redraw_mailbox(w);
  913. X  } /* reset_mailbox */
  914. X- 
  915. X--- 577,579 ----
  916. X*** ../v1.1/MailwatchP.h    Mon Jun  4 09:46:28 1990
  917. X--- MailwatchP.h    Mon Aug 27 11:09:17 1990
  918. X***************
  919. X*** 15,21 ****
  920. X  typedef struct {            /* new fields for mailwatch widget */
  921. X      Pixel    foreground_pixel;    /* color index of normal state fg */
  922. X      GC        normal_GC;        /* normal GC to use */
  923. X!     GC        invert_GC;        /* invert GC to use */
  924. X      int        update;            /* seconds between updates */
  925. X      String    filename;        /* filename to watch */
  926. X      long    last_size;        /* size in bytes of mailboxname */
  927. X--- 15,21 ----
  928. X  typedef struct {            /* new fields for mailwatch widget */
  929. X      Pixel    foreground_pixel;    /* color index of normal state fg */
  930. X      GC        normal_GC;        /* normal GC to use */
  931. X!     GC        invert_GC;        /* invert GC for FillRectangle call */
  932. X      int        update;            /* seconds between updates */
  933. X      String    filename;        /* filename to watch */
  934. X      long    last_size;        /* size in bytes of mailboxname */
  935. X***************
  936. X*** 23,28 ****
  937. X--- 23,31 ----
  938. X      Boolean    reverseVideo;        /* do reverse video? */
  939. X      Boolean    flag_up;        /* is the flag up? */
  940. X      Boolean    bell;            /* ring the bell on new mail? */
  941. X+     Boolean    useName;        /* add username to icon image? */
  942. X+     String    username;        /* username of mailbox */
  943. X+     XFontStruct *font;            /* font to use when displaying name */
  944. X      String    mail;            /* author/subject/date info to "get" */
  945. X      String    flagup;            /* path to alternate icon to use */
  946. X      String    flagdown;        /* path to alternate icon to use */
  947. X*** ../v1.1/actions.c    Mon Jun  4 09:48:34 1990
  948. X--- actions.c    Mon Aug 27 11:09:18 1990
  949. X***************
  950. X*** 32,38 ****
  951. X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
  952. X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  953. X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  954. X!  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  955. X   * PERFORMANCE OF THIS SOFTWARE.
  956. X   *
  957. X   * The following software modules were created and are Copyrighted by National
  958. X--- 32,38 ----
  959. X   * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
  960. X   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  961. X   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  962. X!  * OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  963. X   * PERFORMANCE OF THIS SOFTWARE.
  964. X   *
  965. X   * The following software modules were created and are Copyrighted by National
  966. X***************
  967. X*** 53,66 ****
  968. X   * 13. MyNotify:
  969. X   * 14. NextField:
  970. X   * 15. PrintMsg:
  971. X!  * 16. SetAliases:
  972. X!  * 17. SetCursor:
  973. X!  * 18. SetDirectory:
  974. X!  * 19. SetFolders:
  975. X!  * 20. SetHelp:
  976. X!  * 21. SetMenu:
  977. X!  * 22. SetPopup: and
  978. X!  * 23. SetSelect.
  979. X   *
  980. X   * Author:  Michael C. Wagnitz - National Semiconductor Corporation
  981. X   *
  982. X--- 53,68 ----
  983. X   * 13. MyNotify:
  984. X   * 14. NextField:
  985. X   * 15. PrintMsg:
  986. X!  * 16. SavePos:
  987. X!  * 17. SetAliases:
  988. X!  * 18. SetCursor:
  989. X!  * 19. SetDirectory:
  990. X!  * 20. SetFolders:
  991. X!  * 21. SetHelp:
  992. X!  * 22. SetMenu:
  993. X!  * 23. SetPopup:
  994. X!  * 24. SetPos: and
  995. X!  * 25. SetSelect.
  996. X   *
  997. X   * Author:  Michael C. Wagnitz - National Semiconductor Corporation
  998. X   *
  999. X***************
  1000. X*** 68,74 ****
  1001. X  
  1002. X  
  1003. X  #include "global.h"
  1004. X! #include <math.h>
  1005. X  #include <ctype.h>
  1006. X  #ifdef SUNOS_4
  1007. X  #include <dirent.h>
  1008. X--- 70,76 ----
  1009. X  
  1010. X  
  1011. X  #include "global.h"
  1012. X! #include "xmailregex.h"
  1013. X  #include <ctype.h>
  1014. X  #ifdef SUNOS_4
  1015. X  #include <dirent.h>
  1016. X***************
  1017. X*** 76,81 ****
  1018. X--- 78,84 ----
  1019. X  #include <sys/dir.h>
  1020. X  #endif
  1021. X  
  1022. X+ XtTextPosition SavedPos;
  1023. X  
  1024. X  /*
  1025. X  ** @(#)CheckInsert() - prevents the user from munging up the File: prompt.
  1026. X***************
  1027. X*** 222,229 ****
  1028. X  String        *params;
  1029. X  Cardinal    *num_params;
  1030. X  {
  1031. X!  int    i, n;
  1032. X  
  1033. X      strcpy(Command, "");
  1034. X      for (i = 0; i < *num_params; i++) {
  1035. X          strcat(Command, params[i]);
  1036. X--- 225,239 ----
  1037. X  String        *params;
  1038. X  Cardinal    *num_params;
  1039. X  {
  1040. X!  int        i, n;
  1041. X!  char        buf[BUFSIZ];
  1042. X!  Arg        args[1];
  1043. X!  LabelWidget    lw = (LabelWidget) WidgetOf(WidgetOf(WidgetOf(toplevel,
  1044. X!                     "topBox"), "titleBar"), "titleBar");
  1045. X  
  1046. X+  if (strcmp(params[0], "drop") == 0)
  1047. X+     DropIt(w, *params, NULL);
  1048. X+  else {
  1049. X      strcpy(Command, "");
  1050. X      for (i = 0; i < *num_params; i++) {
  1051. X          strcat(Command, params[i]);
  1052. X***************
  1053. X*** 230,250 ****
  1054. X          strcat(Command, " ");
  1055. X         }
  1056. X      if (i)
  1057. X!     Command[strlen(Command)-1] = '\0';    /* Drop the last trailing blank */
  1058. X      strcat(Command, "\n");
  1059. X  
  1060. X!  if (mailpid)                /* If connections are okay,... */
  1061. X!     writeMail(Command);
  1062. X!  else if (strcmp(Command, "file %\n") != 0)
  1063. X!          Bell("No mail\n");        /* If not 'new mail', complain */
  1064. X!       else {
  1065. X!          if (strcmp(mailargv[mailargc - 2], "-f") == 0) {
  1066. X!             mailargc -= 2;        /* throw away any folder argument */
  1067. X!             mailargv[mailargc] = NULL;    /* and NULL end of argument list */
  1068. X!            }
  1069. X!          callMail(mailargc, mailargv);    /* restart the mail connections */
  1070. X!          strcpy(Command, "Start");    /* Let em know we've re-started */
  1071. X!          UnsetNewmail(w, NULL, NULL);
  1072. X     }
  1073. X  } /* DoCmd */
  1074. X  
  1075. X--- 240,271 ----
  1076. X          strcat(Command, " ");
  1077. X         }
  1078. X      if (i)
  1079. X!        Command[strlen(Command)-1] = '\0'; /* Drop the last trailing blank */
  1080. X      strcat(Command, "\n");
  1081. X  
  1082. X!     if (mailpid) {            /* If connections are okay,... */
  1083. X!        if ((n = match(&command_pattern, Command)) != C_FILE && n != C_NEWMAIL)
  1084. X!           writeMail(Command);
  1085. X!        else {                /* check for commit of any changes */
  1086. X!           XtSetArg(args[0], XtNlabel, (XtArgVal) NULL);
  1087. X!           XtGetValues(lw, args, ONE);
  1088. X!           strcpy(buf, (char *)args[0].value);
  1089. X! 
  1090. X!           if (strcmp(&buf[strlen(buf)-7],"deleted") ||
  1091. X!               Confirm("COMMIT all changes to this folder"))
  1092. X!              writeMail(Command);
  1093. X!          }
  1094. X!       } else if (C_NEWMAIL != match(&command_pattern, Command))
  1095. X!                 Bell("No mail\n");    /* If not 'new mail', complain */
  1096. X!         else {
  1097. X!              if (strcmp(mailargv[mailargc - 2], "-f") == 0) {
  1098. X!                 mailargc -= 2;        /* throw away any folder argument */
  1099. X!                 mailargv[mailargc] = NULL; /* and NULL end of argument list */
  1100. X!                }
  1101. X!              callMail(mailargc, mailargv); /* restart the mail connections */
  1102. X!              strcpy(Command, "Start");    /* Let em know we've re-started */
  1103. X!              UnsetNewmail(w, NULL, NULL);
  1104. X!             }
  1105. X     }
  1106. X  } /* DoCmd */
  1107. X  
  1108. X***************
  1109. X*** 260,266 ****
  1110. X  String        *params;
  1111. X  Cardinal    *num_params;
  1112. X  {
  1113. X!  Done(w, *params, NULL);
  1114. X  } /* DoDone */
  1115. X  
  1116. X  
  1117. X--- 281,298 ----
  1118. X  String        *params;
  1119. X  Cardinal    *num_params;
  1120. X  {
  1121. X!  Widget        Popup = XtParent(XtParent(w));
  1122. X!  Widget        To    = WidgetOf(WidgetOf(Popup, "SubjCc"), "To");
  1123. X! 
  1124. X! 
  1125. X!  if (strcmp(params[0], "ReEdit") != 0)
  1126. X!     Done(w, *params, NULL);
  1127. X!  else {
  1128. X!     XtPopdown(Popup);
  1129. X!     editMail();
  1130. X!     XtPopup(Popup, XtGrabNone);
  1131. X!     XWarpPointer(XtDisplay(toplevel), None, XtWindow(To), 0, 0, 0, 0, 10, 5);
  1132. X!    }
  1133. X  } /* DoDone */
  1134. X  
  1135. X  
  1136. X***************
  1137. X*** 332,337 ****
  1138. X--- 364,370 ----
  1139. X         if (*params[0] != 'n' && *params[0] != '-') {
  1140. X            pos = XtTextGetInsertionPoint(iw);
  1141. X            num = PositionToMsgNumber(pos);    /* no current msg equals zero */
  1142. X+           pos = XtTextGetInsertionPoint(iw);
  1143. X            if (num && *params[0] == 'u' && IndexBuf[pos + 1] != 'D') num = 0;
  1144. X           }
  1145. X         if (num) sprintf(Command, "%s %d\n", params[0], num);
  1146. X***************
  1147. X*** 353,358 ****
  1148. X--- 386,395 ----
  1149. X  String        *params;
  1150. X  Cardinal    *num_params;
  1151. X  {
  1152. X+  char        buf[BUFSIZ];
  1153. X+  Arg        args[1];
  1154. X+  LabelWidget    lw = (LabelWidget) WidgetOf(WidgetOf(WidgetOf(toplevel,
  1155. X+                     "topBox"), "titleBar"), "titleBar");
  1156. X   XtTextPosition pos;
  1157. X   char        *p;
  1158. X   Cardinal    n;
  1159. X***************
  1160. X*** 363,371 ****
  1161. X   else {
  1162. X      FileBuf[StartPos + n] = '\0';
  1163. X      p = FileBuf + StartPos;
  1164. X!     if (mailpid) {
  1165. X!        sprintf(Command, "file %s\n", p);
  1166. X!        writeMail(Command);
  1167. X        } else {
  1168. X  /*
  1169. X  ** We must first re-establish contact with the mail utility.
  1170. X--- 400,415 ----
  1171. X   else {
  1172. X      FileBuf[StartPos + n] = '\0';
  1173. X      p = FileBuf + StartPos;
  1174. X!     if (mailpid) {            /* check for commit of any changes */
  1175. X!        XtSetArg(args[0], XtNlabel, (XtArgVal) NULL);
  1176. X!        XtGetValues(lw, args, ONE);
  1177. X!        strcpy(buf, (char *)args[0].value);
  1178. X! 
  1179. X!        if (strcmp(&buf[strlen(buf) - 7], "deleted") ||
  1180. X!            Confirm("COMMIT all changes to this folder")) {
  1181. X!           sprintf(Command, "file %s\n", p);
  1182. X!           writeMail(Command);
  1183. X!          }
  1184. X        } else {
  1185. X  /*
  1186. X  ** We must first re-establish contact with the mail utility.
  1187. X***************
  1188. X*** 489,494 ****
  1189. X--- 533,553 ----
  1190. X  
  1191. X  
  1192. X  /*
  1193. X+ ** @(#)SavePos() - save the current insert position of the widget
  1194. X+ */
  1195. X+ /* ARGSUSED */
  1196. X+ XtActionProc
  1197. X+ SavePos(w, event, params, num_params)
  1198. X+ Widget        w;
  1199. X+ XEvent        *event;
  1200. X+ String        *params;
  1201. X+ Cardinal    *num_params;
  1202. X+ {
  1203. X+  SavedPos = XtTextGetInsertionPoint(w);
  1204. X+ } /* SavePos */
  1205. X+ 
  1206. X+ 
  1207. X+ /*
  1208. X  ** @(#)SetAliases() - create a menu list of alias names
  1209. X  */
  1210. X  /* ARGSUSED */
  1211. X***************
  1212. X*** 673,680 ****
  1213. X   if (! popup || popup->core.being_destroyed) {
  1214. X      p = GetMailEnv("folder");            /* returns NULL if none */
  1215. X      if (p && strlen(p)) {
  1216. X!        sprintf(foldir, "%s/%s/", getenv("HOME"), p);
  1217. X!        XtFree((char *)p);            /* p still has an address */
  1218. X        } else
  1219. X         strcpy(foldir, "");    /* If no folder variable, then no folders */
  1220. X      foldlen = strlen(foldir);
  1221. X--- 732,750 ----
  1222. X   if (! popup || popup->core.being_destroyed) {
  1223. X      p = GetMailEnv("folder");            /* returns NULL if none */
  1224. X      if (p && strlen(p)) {
  1225. X!        /*
  1226. X!     * Don't prepend HOME if it starts with a slash or a .
  1227. X!     */
  1228. X!        if (index("/.", *p))
  1229. X!        strcpy(foldir, p);
  1230. X!        else
  1231. X!        sprintf(foldir, "%s/%s", getenv("HOME"), p);
  1232. X!        XtFree((char *)p);
  1233. X!        /*
  1234. X!     * Make sure it ends with (only one) slash
  1235. X!     */
  1236. X!        if (LASTCH(foldir) != '/')
  1237. X!           strcat(foldir, "/");
  1238. X        } else
  1239. X         strcpy(foldir, "");    /* If no folder variable, then no folders */
  1240. X      foldlen = strlen(foldir);
  1241. X***************
  1242. X*** 699,705 ****
  1243. X                        }
  1244. X                      strcat(List, " ");
  1245. X                      strcat(List, dp->d_name);
  1246. X!                     if (++x % 6 == 0) {
  1247. X                         x = 0;
  1248. X                         strcat(List, "\n");
  1249. X                        }
  1250. X--- 769,775 ----
  1251. X                        }
  1252. X                      strcat(List, " ");
  1253. X                      strcat(List, dp->d_name);
  1254. X!                     if (++x % 4 == 0) {
  1255. X                         x = 0;
  1256. X                         strcat(List, "\n");
  1257. X                        }
  1258. X***************
  1259. X*** 709,720 ****
  1260. X              } /* end - if folder directory is readable */
  1261. X           } /* end - if mail process is running */
  1262. X        } /* end - if a folder value exists */
  1263. X  /*
  1264. X  ** determine proper label width by finding longest word length
  1265. X  */
  1266. X      strcpy(trans, "");
  1267. X      x = 0;
  1268. X!     if (p)                /* if folders exist and are readable */
  1269. X         for (p = List; *p; p++) {
  1270. X             if (*p == ' ' || *p == '\n' || *p == '\t') {
  1271. X                if (x) {
  1272. X--- 779,798 ----
  1273. X              } /* end - if folder directory is readable */
  1274. X           } /* end - if mail process is running */
  1275. X        } /* end - if a folder value exists */
  1276. X+ 
  1277. X+     if (List)                /* could be null if no current mail */
  1278. X+        if (O_BELL == match(&output_pattern, List)) {
  1279. X+           strcat(List, "\n");
  1280. X+           Bell(List);
  1281. X+           XtFree((char *)List);
  1282. X+           List = NULL;
  1283. X+          }
  1284. X  /*
  1285. X  ** determine proper label width by finding longest word length
  1286. X  */
  1287. X      strcpy(trans, "");
  1288. X      x = 0;
  1289. X!     if (List)                /* if folders exist and are readable */
  1290. X         for (p = List; *p; p++) {
  1291. X             if (*p == ' ' || *p == '\n' || *p == '\t') {
  1292. X                if (x) {
  1293. X***************
  1294. X*** 744,750 ****
  1295. X  /*
  1296. X  ** Now, make equal width command buttons which contain the folder names
  1297. X  */
  1298. X!        XtSetArg(args[0], XtNwidth, XTextWidth(TextFontStr, trans, n) + 14);
  1299. X         XtSetArg(args[1], XtNfont, TextFontStr);
  1300. X         XtSetArg(args[2], XtNtranslations, XtParseTranslationTable(fl_trans));
  1301. X         XtSetArg(args[3], XtNcallback, fl_callbacks);
  1302. X--- 822,828 ----
  1303. X  /*
  1304. X  ** Now, make equal width command buttons which contain the folder names
  1305. X  */
  1306. X!        XtSetArg(args[0], XtNwidth, XTextWidth(TextFontStr, trans, n) + 20);
  1307. X         XtSetArg(args[1], XtNfont, TextFontStr);
  1308. X         XtSetArg(args[2], XtNtranslations, XtParseTranslationTable(fl_trans));
  1309. X         XtSetArg(args[3], XtNcallback, fl_callbacks);
  1310. X***************
  1311. X*** 823,834 ****
  1312. X      if (! *foldir)
  1313. X         Bell("No value set for \"folder\"\n");
  1314. X      else {
  1315. X!        if (dirp && !mailpid) {
  1316. X!           Bell("No mail folders exist\n");
  1317. X!          } else {
  1318. X!           foldir[foldlen - 1] = '\0';
  1319. X!           sprintf(tmp, "%s not found\n", foldir);
  1320. X!           Bell(tmp);
  1321. X           }
  1322. X        }
  1323. X     } else {
  1324. X--- 901,914 ----
  1325. X      if (! *foldir)
  1326. X         Bell("No value set for \"folder\"\n");
  1327. X      else {
  1328. X!        if (dirp) {
  1329. X!           if (! mailpid) {
  1330. X!              Bell("No mail folders exist\n");
  1331. X!             } else {
  1332. X!              foldir[foldlen - 1] = '\0';
  1333. X!              sprintf(tmp, "%s not found\n", foldir);
  1334. X!              Bell(tmp);
  1335. X!             }
  1336. X           }
  1337. X        }
  1338. X     } else {
  1339. X***************
  1340. X*** 854,861 ****
  1341. X      XtSetValues(popup, (ArgList) args, 2);
  1342. X     }
  1343. X  
  1344. X!  XtFree((char *)List);
  1345. X! 
  1346. X  } /* SetFolders */
  1347. X  
  1348. X  
  1349. X--- 934,941 ----
  1350. X      XtSetValues(popup, (ArgList) args, 2);
  1351. X     }
  1352. X  
  1353. X!  if (List)
  1354. X!     XtFree((char *)List);
  1355. X  } /* SetFolders */
  1356. X  
  1357. X  
  1358. X***************
  1359. X*** 931,937 ****
  1360. X   static String m_Trans =
  1361. X      "<Btn3Up>:    MenuPopdown(set_menu)";
  1362. X  
  1363. X!  static String list[] = { "alwaysignore", "autoprint", "hold", NULL };
  1364. X  
  1365. X  
  1366. X   menu = XtNameToWidget(parent, "set_menu");
  1367. X--- 1011,1017 ----
  1368. X   static String m_Trans =
  1369. X      "<Btn3Up>:    MenuPopdown(set_menu)";
  1370. X  
  1371. X!  static String list[] = { "alwaysignore", "autoprint", "hold", "expert", NULL };
  1372. X  
  1373. X  
  1374. X   menu = XtNameToWidget(parent, "set_menu");
  1375. X***************
  1376. X*** 953,961 ****
  1377. X      XtSetArg(args[3], XtNtranslations, XtParseTranslationTable(b_Trans));
  1378. X      for (indx = 0; list[indx] != NULL; indx++) {
  1379. X          strcpy(label, "set ");
  1380. X!         if ((c = GetMailEnv(list[indx])) != NULL) {
  1381. X!            strcat(label, "no");
  1382. X!            XtFree(c);
  1383. X            }
  1384. X          strcat(label, list[indx]);        /* set window name by label */
  1385. X          strcpy(name, &label[4]);
  1386. X--- 1033,1046 ----
  1387. X      XtSetArg(args[3], XtNtranslations, XtParseTranslationTable(b_Trans));
  1388. X      for (indx = 0; list[indx] != NULL; indx++) {
  1389. X          strcpy(label, "set ");
  1390. X!         if (strcmp(list[indx], "expert") == 0) {
  1391. X!            if (XMail.expert)
  1392. X!               strcat(label, "no");
  1393. X!           } else {
  1394. X!            if ((c = GetMailEnv(list[indx])) != NULL) {
  1395. X!               strcat(label, "no");
  1396. X!               XtFree(c);
  1397. X!              }
  1398. X            }
  1399. X          strcat(label, list[indx]);        /* set window name by label */
  1400. X          strcpy(name, &label[4]);
  1401. X***************
  1402. X*** 1035,1081 ****
  1403. X  } /* SetPopup */
  1404. X  
  1405. X  
  1406. X  /* ARGSUSED */
  1407. X  /*
  1408. X! ** @(#)SetSelect() - highlight the index number of the selected message
  1409. X  */
  1410. X  XtActionProc
  1411. X  SetSelect(w, event, params, num_params)
  1412. X! Widget w;
  1413. X  XEvent *event;        /* unused */
  1414. X  String *params;        /* unused */
  1415. X  Cardinal *num_params;    /* unused */
  1416. X  {
  1417. X!  XClientMessageEvent    cm;
  1418. X!  XtTextPosition pos, left, right;
  1419. X!  String    s;
  1420. X! 
  1421. X! 
  1422. X!  pos = XtTextGetInsertionPoint(w);
  1423. X! 
  1424. X!  for (s = IndexBuf + pos; s > IndexBuf && *(s - 1) != '\n'; s--);
  1425. X! 
  1426. X!  pos = s - IndexBuf;
  1427. X! /*
  1428. X! ** use XSendEvent to remove any prior selection highlight
  1429. X! */
  1430. END_OF_FILE
  1431. if test 49821 -ne `wc -c <'Patch.02a'`; then
  1432.     echo shar: \"'Patch.02a'\" unpacked with wrong size!
  1433. fi
  1434. # end of 'Patch.02a'
  1435. fi
  1436. echo shar: End of archive 3 \(of 5\).
  1437. cp /dev/null ark3isdone
  1438. MISSING=""
  1439. for I in 1 2 3 4 5 ; do
  1440.     if test ! -f ark${I}isdone ; then
  1441.     MISSING="${MISSING} ${I}"
  1442.     fi
  1443. done
  1444. if test "${MISSING}" = "" ; then
  1445.     echo You have unpacked all 5 archives.
  1446.     rm -f ark[1-9]isdone
  1447. else
  1448.     echo You still need to unpack the following archives:
  1449.     echo "        " ${MISSING}
  1450. fi
  1451. ##  End of shell archive.
  1452. exit 0
  1453.  
  1454. dan
  1455. ----------------------------------------------------
  1456. O'Reilly && Associates   argv@sun.com / argv@ora.com
  1457. Opinions expressed reflect those of the author only.
  1458.